<!doctype html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>${gloableBankName}</title>
<link href="${basePath}/css/common/login.css" rel="stylesheet" type="text/css"/>
<#include 'frame/version.html'/>
<link rel="shortcut icon" type="image/ico" href="${basePath}/favicon.ico?${script_version}"/>
<link rel="stylesheet" type="text/css" href="${basePath}/css/manage/commons_include_2.css"/>
<link rel="stylesheet" type="text/css" href="${basePath}/css/manage/frame_include.css?${script_version}"/>
<link rel="stylesheet" type="text/css" href="${basePath}/js/layer/skin/layer.css" />
<style type="text/css">
.IndexFoot{position: absolute;bottom: 0;}body {background: #fff;}
</style>
</head>
<body id="nv_member">
		<#include "/include/header.html"/>
	<div class="content clr" style="background:#fff;padding:10px 0 80px 0 ;">
    <div class="congtX">
        <div class="contLt clr">
            <form action="#" method="post" class="login">
                <div class="name clr"> <span>账号:</span>
                	<em></em>
                    <input class="text" type="text" name="username" id="username" value="" placeholder="请输入用户名" />
                </div>
                <br />
                <div class="password clr"> <span>密码:</span>
                	<em></em>
                    <input class="text" type="password" name="password" id="password" value="" placeholder="请输入密码"/>
                </div>
                <div class="yanzheng clr">
                	<span>验证码:</span>
                	<em></em>
                    <input name="verifycode" type="text" size="8" id="input_vcode" class="text" maxlength="4" placeholder="验证码"/>
                    <img src="${basePath}/anon/vcode" id="txtCheckCode2" style="width:75px;margin-top:3px;" />
                    <a href="javascript:refreshImg2();"> 看不清？换一张 </a> 
                </div>
               	<br/>
                <button class="login_button" type="button" id="login_button" name="login_button">登录</button>
            </form>
        </div>
    </div>
	</div>
<#include "/include/footer.html"/>

<#include 'frame/manage/include_js.html'/>
<script>
$(document).ready(function() {
	$(document).keydown(function(e){ 
		var curKey = e.which; 
		if(curKey == 13){ 
		$("#login_button").click(); 
			return false; 
		} 
     }); 
	$("#login_button").click(function(){
		var username=$('#username').val();
		var password=$('#password').val();
		if(username==""){
			$('#username').focus();
			layer.tips('请输入用户名','#username');
			return false;
		}
		
		if(password==""){
			$('#password').focus();
			layer.tips('请输入密码','#password');
			return false;
		}
		var $vcode = $("#input_vcode");
		if($vcode.val()==""){
			$vcode.focus();
			layer.tips("请填写验证码","#input_vcode");
			return false;
		}
		$.ajax({
			type:'post',
			url:"${basePath}/admin/login/anon/valid",
			data:{"username":username,"password":password,"verifycode":$vcode.val()},
			cache:false,
			success:function(type_json, textStatus){
				if(type_json.success == true){
					window.location.href="${basePath}/admin/index";
	      		}else{
	      			console.log(type_json["errorMsg"]);
	    	  		layer.msg(type_json["errorMsg"],{shift:0});
	    	  		refreshImg2();
				}
			}
	    });
    });
});
function refreshImg2(){
	$("#txtCheckCode2").attr("src","${basePath}/anon/vcode?v="+Number(new Date()));
}
</script>
</body>
</html>